/*
 * @Date         : 2024-03-01 20:29:20
 * @LastEditTime : 2024-03-08 21:30:08
 * @description  :
 */
import { fileURLToPath, URL } from "node:url";
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import AutoImport from "unplugin-auto-import/vite";
import Components from "unplugin-vue-components/vite";
import { ElementPlusResolver } from "unplugin-vue-components/resolvers";
// https://vitejs.dev/config/
export default defineConfig({
  base: process.env.NODE_ENV === "production" ? "/zydt/" : "/",
  plugins: [
    vue(),
    AutoImport({
      // 使用
      imports: ["vue"],
      dts: "src/auto-import.d.ts",
      // 如有用到eslint记得加上写段，没有用到可以忽略
      // eslintrc: {
      //   enabled: true,
      // },
      resolvers: [ElementPlusResolver()],
    }),
    Components({
      resolvers: [ElementPlusResolver()],
    }),
  ],
  resolve: {
    alias: {
      "@": fileURLToPath(new URL("./src", import.meta.url)),
    },
  },
});
